package com.schoolET.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.schoolET.entity.AdminAndRegion;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 管理员和管理区域表 Mapper 接口
 * </p>
 *
 * @author le
 * @since 2024-06-01
 */
@Mapper
public interface AdminAndRegionMapper extends BaseMapper<AdminAndRegion> {


    @Delete("delete from admin_and_region where admin_id = #{adminId}")
    Integer deleteByAdminId(Integer adminId);

    @Select("select * from admin_and_region where admin_id = #{adminId} and flag = 0")
    AdminAndRegion selectByAdminId(Integer adminId);

    @Select("select * from admin_and_region where region_id = #{regionId} and flag = 0")
    AdminAndRegion selectByRegionId(Integer regionId);

}
